﻿using PLCS.App.Shared.Events;

using System.Windows.Controls;
using System.Windows.Forms;

using UserControl = System.Windows.Controls.UserControl;

namespace PLCS.App.Views
{
    /// <summary>
    /// MonitorView.xaml 的交互逻辑
    /// </summary>
    public partial class MonitorView : UserControl
    {
        private readonly IEventAggregator _aggregator;

        public MonitorView()
        {
            InitializeComponent();
            _aggregator = ContainerLocator.Container.Resolve<IEventAggregator>();
            _aggregator.GetEvent<ErrorLogCountEvent>().Subscribe(count => this.Dispatcher.BeginInvoke(new Action(() =>
            {
                bd.Badge = count;
            })));
        }
    }
}